assume cs:code

code segment
    start:mov al, 22
          call showstr

          mov ax, 4c00h
          int 21h

showstr: jmp short show
         table db '0123456789ABCDEF'
   show: push es
         push bx
         mov ah, al
         shr ah, 1
         shr ah, 1
         shr ah, 1
         shr ah, 1
         and al, 00001111B

         mov bx, 0b800h
         mov es, bx

         mov bh, 0
         mov bl, ah
         mov bl, table[bx]
         mov es:[160 * 12 + 40 * 2], bl
        
         mov bh, 0
         mov bl, al
         mov bl, table[bx]
         mov es:[160 * 12 + 40 * 2 + 2], bl

         pop bx
         pop es
         ret

code ends
end start
